package cn.wh.org.service.impl;

import cn.wh.basic.query.BaseQuery;
import cn.wh.basic.service.impl.BaseServiceImpl;
import cn.wh.basic.util.PageList;
import cn.wh.org.domain.Details;
import cn.wh.org.mapper.DetailsMapper;
import cn.wh.org.query.DetailsQuery;
import cn.wh.org.service.IDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DetailsServiceImpl extends BaseServiceImpl<Details> implements IDetailsService {

    @Autowired
    private DetailsMapper detailsMapper;

    @Override
    public void deleteBytypeid(Long typeid) {
        detailsMapper.deleteBytypeid(typeid);
    }

    /*@Override
    public PageList<Details> queryId(BaseQuery query) {
        return detailsMapper.queryId(query);
    }*/

    @Override
    public PageList<Details> queryPageByType_id(DetailsQuery query) {
        Long total = detailsMapper.queryCount(query);
        List<Details> rows = detailsMapper.queryDataByType_id(query);
        return new PageList<Details>(total,rows);
    }
}
